import { request } from "../utils/request";

export const getAddressList = () => {
  return request.get("/address", {
    params: {
      page: 1,
      pageSize: 9999,
    },
  });
};

export const updateAddress = (data) => {
  return request.put("/address", data);
};

export const createAddress = (data) => {
  return request.post("/address", data);
};

export const getAddress = (id) => {
  return request.get(`/address/${id}`);
};

export const deleteAddress = (_id) => {
  return request({
    url: "/address",
    method: "DELETE",
    data: {
      _id,
    },
  });
};
